package com.gluz.gluz_flutter;

import io.flutter.embedding.android.FlutterFragmentActivity;
import io.flutter.embedding.engine.FlutterEngine;

public class MainActivity extends FlutterFragmentActivity {
    
    private NativeBridge nativeBridge;
    
    @Override
    public void configureFlutterEngine(FlutterEngine flutterEngine) {
        super.configureFlutterEngine(flutterEngine);
        
        // 初始化NativeBridge
        nativeBridge = NativeBridge.getInstance(this);
        nativeBridge.initialize(flutterEngine.getDartExecutor().getBinaryMessenger());
    }
    
    @Override
    protected void onDestroy() {
        super.onDestroy();
        
        // 释放NativeBridge资源
        if (nativeBridge != null) {
            nativeBridge.dispose();
            nativeBridge = null;
        }
    }
}
